package api

import (
	"github.com/gin-gonic/gin"
	"yzy6.26exam/api/handler"
	"yzy6.26exam/api/middlewere"
)

func Run(router *gin.Engine) {
	Origin := router.Group("/", middlewere.Origin())
	Origin.POST("/request", handler.Request)
	Origin.POST("/login", handler.Login)
	UserAuthMiddleWere := Origin.Group("/", middlewere.UserAuthMiddleWere())
	UserAuthMiddleWere.POST("/upload", handler.Upload)
	UserAuthMiddleWere.POST("/video/push", handler.VideoPush)
	UserAuthMiddleWere.POST("/video/list", handler.VideoList)
	UserAuthMiddleWere.POST("/video/my_push", handler.VideoMyPush)
	UserAuthMiddleWere.POST("/like", handler.Like)
	UserAuthMiddleWere.POST("/like/find", handler.LikeFind)
	UserAuthMiddleWere.POST("/commit/push", handler.CommitPush)
	UserAuthMiddleWere.POST("/commit/list", handler.CommitList)
	UserAuthMiddleWere.POST("/witch", handler.Witch)

}
